import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import { createPinia } from "pinia";
//引入图片懒加载插件
import Lazyload from "vue-lazyload";
import './iconfont/iconfont.css';
import 'vant/lib/index.css'// 这里
import './style.css';

import imageLoading from "@/assets/images/image_loading.gif";
import imageError from "@/assets/images/image_error.jpg";
import Vant from 'vant';
import { Toast,Loading,Dialog } from 'vant';
import { Icon } from 'vant';

import Echarts from "vue-echarts"
import * as echarts from "echarts"
 

// 移动端基础配置 处理
import "@utils/baseResolve.js"

import VConsole from 'vconsole';

const vConsole = new VConsole();

const pinia = createPinia();

const app = createApp(App);

app.use(router);
app.use(pinia);
app.use(Vant);
app.use(Toast);
app.use(Icon);
app.use(Loading);
app.use(Dialog);

app.component("v-chart", Echarts)
app.config.globalProperties.$echarts = echarts

//注册插件
app.use(Lazyload, {
    loading: imageLoading, //可以指定加载中的图像
    error: imageError, //可以指定加载失败的图像
 });

// 现在，应用已经启动了！
app.mount("#app");